﻿#ifndef __SS_LOG_THREAD_H__
#define __SS_LOG_THREAD_H__
#include "../thread/ssMsgThread.h"
#include "../ssSingleton.h"
#include "./ssLogBase.h"


namespace StarSeeker
{

class ssLogThread : public ssMsgThread, public ssLogBase
{
public:
	// 构造和析构
	ssLogThread();
	ssLogThread(u8 type, const char* path);
	~ssLogThread();
	//输出日志
	void OutPut(SS_LOG_TYPE type, const char *pLogString);
	void OutPutEx(SS_LOG_TYPE type, const char *pLogString, ...);
	//兼容旧函数
	void PrintDebug(const char *pLogString);
	void PrintDebugEx(const char *pLogString, ...);
	void Print(const char *pLogString);
	void PrintEx(const char *pLogString, ...);
	void Error(const char *pLogString);
	void ErrorEx(const char *pLogString, ...);
	//只写入文件
	void PrintFile(const char *pLogString);
	void PrintFileEx(const char *pLogString, ...);
private:
	// 线程函数
	void HandleMessage(ssMsg_s &m);
};

}

#define SS_LOG StarSeeker::ssSingle<StarSeeker::ssLogThread>::instance()

#endif
